package com.reggie.service.impl;

import com.reggie.mapper.OrderdetailMapper;
import com.reggie.pojo.OrderDetail;
import com.reggie.service.OrderdetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderdetailServiceImpl implements OrderdetailService {
    @Autowired
    OrderdetailMapper orderdetailMapper;

    @Override
    public boolean add(OrderDetail orderDetail) {
        if(orderdetailMapper.add(orderDetail)==1) return true;
        return false;
    }

    @Override
    public List<OrderDetail> findByOrderId(Long orderId) {
        List<OrderDetail> orderDetails = orderdetailMapper.findByOrderId(orderId);
        return orderDetails;
    }
}
